package com.music.wangyi.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProvider
import com.music.wangyi.Base.BaseFragment
import com.music.wangyi.R
import com.music.wangyi.databinding.FragmentIphoneLoginBinding
import com.music.wangyi.databinding.FragmentLoginBinding
import com.music.wangyi.model.LoginModel

class IphoneLoginFragment: BaseFragment() {
    private lateinit var model: LoginModel
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val binding: FragmentIphoneLoginBinding = DataBindingUtil.inflate(inflater,R.layout.fragment_iphone_login,container,false)
        model = activity?.run {
            ViewModelProvider(this).get(LoginModel::class.java)
        }?:throw Exception("Invalid Activity")
        binding.model = model
        return binding.root
    }
}